[10/11] icmp: introduce helper for nat'd source address in network device context
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 11 Feb 2020 19:47:05 +0000 (20:47 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Mon, 30 Mar 2020 21:06:57 +0000 (22:06 +0100)
commit961b3f81cb56d4f57954d4415ddd12da6ae09de9
tree25154aed266b9f8c199c8d0e2effc2df5e3cfd0d
parentdd0d5c4eb1e14c669c461e129b66d5e4f9612909
[10/11] icmp: introduce helper for nat'd source address in network device context

Origin: https://git.zx2c4.com/wireguard-linux/commit?id=dece343674f61484816a13784d716f1d7098fa05
Bug-Debian: https://bugs.debian.org/953569

This introduces a helper function to be called only by network drivers
that wraps calls to icmp[v6]_send in a conntrack transformation, in case
NAT has been used. We don't want to pollute the non-driver path, though,
so we introduce this as a helper to be called by places that actually
make use of this, as suggested by Florian.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: commits 0b41713b606694257b90d61ba7e2712d8457648b and
 a8e41f6033a0c5633d55d6e35993c9e2005d872f "icmp: allow icmpv6_ndo_send to work with CONFIG_IPV6=n"
 upstream]

Gbp-Pq: Topic features/all/wireguard
Gbp-Pq: Name 0010-icmp-introduce-helper-for-nat-d-source-address-in-ne.patch
include/linux/icmpv6.h
include/net/icmp.h
net/ipv4/icmp.c
net/ipv6/ip6_icmp.c